<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace api\wxapp\controller;
use cmf\controller\RestBaseController;
use api\wxapp\model\SchoolSubjectModel;
use api\wxapp\model\SchoolCourseModel;

class SubjectController extends RestBaseController
{    
    protected $postModel;
    public function __construct(SchoolSubjectModel $postModel)
    {
        parent::__construct();
        $this->postModel = $postModel;
    }

    public function index()
    {        
        $params = $this->request->param();        
        $data = $this->postModel 
            ->with(['schoolCourse'=>['schoolClass','schoolLevel','schoolSubject','schoolTeacher']])        
            ->order('list_order ASC')  
            ->where("delete_time",0)
            ->select();            
        $this->success('请求成功!', $data);
    }
}
